package com.md.config.demo;

import com.alibaba.cloud.nacos.NacosDiscoveryProperties;
import com.md.util.StringUtil;
import org.springframework.cloud.commons.util.InetUtils;

import java.util.List;

/**
 * @author 刘骄阳
 * 2023-02-24 16:17
 */
public class DemoClient {
  private final NacosDiscoveryProperties properties;
  private final DemoInterface demoInterface;
  private final InetUtils inetUtils;

  public DemoClient(final NacosDiscoveryProperties properties, final DemoInterface demoInterface,
                    final InetUtils inetUtils) {
    this.properties = properties;
    this.demoInterface = demoInterface;
    this.inetUtils = inetUtils;
  }

  public void getHttpIp() {
    List<String> query = demoInterface.query();
    System.out.println(StringUtil.objectToJson(query));
    System.out.println();
  }
}
